package com.qztc.hire_end_dto.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

@TableName("theorder") // 因order是MySQL关键字，需用反引号包裹
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Schema(title = "订单信息")
public class Order extends Model<Order> implements Serializable {
    @Schema(title = "订单id")
    @TableId(value = "order_id")
    private int orderId;

    @Schema(title = "用户id，外键")
    @TableField(value = "user_id")
    private int userId;

    @Schema(title = "汉服id，外键")
    @TableField(value = "hanfu_id")
    private int hanfuId;

    @Schema(title = "汉服尺码id，外键")
    @TableField(value = "hanfu_sizeid")
    private int hanfuSizeId;

    @Schema(title = "租赁时长（天）")
    @TableField(value = "rent_time")
    private int rentTime;

    @Schema(title = "订单价格")
    @TableField(value = "total_price")
    private double totalPrice;

    @Schema(title = "订单状态（待支付/已支付/已完成/已取消等）")
    @TableField(value = "status")
    private String status;

    @Schema(title = "租赁开始日期")
    @TableField(value = "rent_startdate")
    private String rentStartDate;

    @Schema(title = "租赁结束日期")
    @TableField(value = "rent_enddate")
    private String rentEndDate;

    @Schema(title = "订单创建时间")
    @TableField(value = "order_createdate")
    private String createDate;
}